<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<script>
		//箭头函数
		let sum = (...params)=>{
			let total = 0;
			for(var i of params){
				total += i;
			};
			return total;
		}
		console.log(sum(1,2,3,4));//10
		//--------------------------------
		console.log("------------------------------------------");

		console.log(...[1,2]);

		//--------------------------------
		console.log("------------------------------------------");
		//数组拼接
		let arr1 = [1,2,3],arr2=[4,5,6];
		let arr3 = [...arr1,...arr2];
		console.log(arr3);//[1,2,3,4,5,6]

		//--------------------------------
		console.log("------------------------------------------");
		//数组的解构赋值
		let [x,y] = [1,2];
		console.log([x,y]);//[1,2]

		//--------------------------------
		console.log("------------------------------------------");

		//数组的解构赋值
		let [x1,...y1] = [1,2,3,4,5,6];
		console.log([x1,...y1]);//[1,2,3,4,5,6]

		//--------------------------------
		console.log("------------------------------------------");

		//字符串结构
		let [a,b,c] ="ABC";
		console.log(a);//A
		console.log(b);//B
		console.log(c);//C

		//--------------------------------
		console.log("------------------------------------------");

		//字符串扩展

		let [xy] = "ABC";


	</script>
</body>
</html>
